package com.ruoyi.project.hcy.task.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.hcy.task.service.IFileUploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartHttpServletRequest;

@Controller
@RequestMapping("/task/fileUpload")
public class FileUploadController extends BaseController {

    @Autowired
    IFileUploadService fileUploadService;

    @RequestMapping("/uploadFile")
    @ResponseBody
    public AjaxResult upload(String fileId, MultipartHttpServletRequest request) {
        return toAjax(fileUploadService.submitTask(fileId, request));
    }
}
